.dialogOverlay {
  background-color: rgba(0, 0, 0, 0.4);
  position: fixed;
  inset: 0;
  animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.dialogContent {
  background-color: white;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 16px;
  animation: contentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 16px;
  border: 1px solid #E3E3E3;
  
  :global(.dark) & {
    background-color: #292A2E;
    border-color: #3F3F46;
    box-shadow: none;
  }
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
  
  :global(.dark) & {
    border-bottom: 1px solid #3F3F46;
  }
}

.title {
  font-size: 14px;
  font-weight: 500;
  color: #151515;
  
  :global(.dark) & {
    color: #E4E4E7;
  }
}

.closeButton {
  all: unset;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  
  &:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #151515;
  }

  svg {
    width: 14px;
    height: 14px;
  }
  
  :global(.dark) & {
    color: #A1A1AA;
    
    &:hover {
      background-color: rgba(255, 255, 255, 0.1);
      color: #E4E4E7;
    }
  }
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  
  :global(.dark) & {
    border-bottom: 1px solid #3F3F46;
  }
}

.selectTrigger {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 13px;
  line-height: 28px;
  height: 28px;
  gap: 4px;
  background-color: white;
  border: 1px solid #e0e0e0;
  color: #151515;
  cursor: pointer;
  min-width: 80px;
  
  &:hover {
    border-color: #bbb;
    background-color: rgba(0, 0, 0, 0.02);
  }

  &:focus {
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
  }
  
  :global(.dark) & {
    background-color: #313234;
    border-color: #3F3F46;
    color: #E4E4E7;
    
    &:hover {
      border-color: #52525B;
      background-color: #3F4043;
    }
    
    &:focus {
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
    }
  }
}

.selectContent {
  overflow: hidden;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  animation: selectContentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
  
  :global(.dark) & {
    background-color: #48494C;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

.selectViewport {
  padding: 4px;
}

.selectItem {
  font-size: 13px;
  line-height: 1;
  color: #151515;
  border-radius: 4px;
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 8px;
  position: relative;
  user-select: none;
  outline: none;
  cursor: pointer;

  &[data-highlighted] {
    background-color: rgba(0, 122, 255, 0.1);
    color: #007AFF;
  }

  &[data-state='checked'] {
    color: #007AFF;
  }
  
  :global(.dark) & {
    color: #E4E4E7;
    
    &[data-highlighted] {
      background-color: rgba(255, 255, 255, 0.1);
      color: #fff;
    }
    
    &[data-state='checked'] {
      color: #fff;
    }
  }
}

.colorButton {
  all: unset;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s;

  &:hover {
    border-color: #bbb;
  }

  &:focus {
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
  }
  
  :global(.dark) & {
    border-color: #3F3F46;
    
    &:hover {
      border-color: #52525B;
    }
    
    &:focus {
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
    }
  }
}

.colorPickerContainer {
  position: relative;
  display: inline-block;
}

.colorPickerContent {
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 10px;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 5px;
  z-index: 1000;
  animation: selectContentShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
  
  :global(.dark) & {
    background-color: #48494C;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  }

  .closeButton {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: #666;

    &:hover {
      background-color: #f5f5f5;
      color: #333;
    }
    
    :global(.dark) & {
      background-color: #313234;
      border-color: #3F3F46;
      color: #A1A1AA;
      
      &:hover {
        background-color: #3F4043;
        color: #E4E4E7;
      }
    }
  }
}

.colorGrid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 4px;
}

.colorOption {
  all: unset;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s;

  &:hover {
    transform: scale(1.1);
  }

  &.activeColor {
    &::after {
      content: '';
      position: absolute;
      inset: -2px;
      border: 2px solid #007AFF;
      border-radius: 6px;
    }
  }
}

.colorPickerArrow {
  fill: white;
}

.formatButtons,
.alignButtons {
  display: flex;
  gap: 4px;
}

.formatButton,
.alignButton {
  all: unset;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  font-size: 13px;
  border: 1px solid #e0e0e0;
  background-color: white;
  
  &:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-color: #bbb;
  }
  
  &.active {
    background-color: rgba(0, 122, 255, 0.1);
    border-color: #007AFF;
    color: #007AFF;
  }

  &:focus {
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
  }
  
  :global(.dark) & {
    background-color: #313234;
    border-color: #3F3F46;
    color: #A1A1AA;
    
    &:hover {
      background-color: #3F4043;
      border-color: #52525B;
    }
    
    &.active {
      background-color: rgba(255, 255, 255, 0.1);
      border-color: #E4E4E7;
      color: #E4E4E7;
    }
    
    &:focus {
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
    }
  }
}

.editor {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  height: 80px;
  outline: none;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.5;
  color: #151515;
  background-color: white;
    
  &:focus {
    border-color: #007AFF;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
  }
  
  :global(.dark) & {
    background-color: #313234;
    border-color: #3F3F46;
    color: #E4E4E7;
    
    &:focus {
      border-color: #52525B;
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
    }
  }
}

.footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  
  :global(.dark) & {
    border-top: 1px solid #3F3F46;
  }
}

.saveButton {
  all: unset;
  background-color: #151515;
  color: white;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  
  &:hover {
    background-color: #2C2C2C;
  }

  &:focus {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
  }
  
  :global(.dark) & {
    background-color: #151515;
    
    &:hover {
      background-color: #2C2C2C;
    }
    
    &:focus {
      box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
    }
  }
}